let a:number[] = [1,2,3]; //推荐这种写法
let aa:Array<number> = [1,2,3];//不推荐

let b :string[] = ["a","b","c","d"];//前面声明了是string[],就只能放入字符串，否则会报错
// let c:boolean[] = [true,false,true,"false"];//只能放入boolean类型，否则会报错

/* 
    联合类型
    | 在ts中就表示联合类型，和js里的 || 不同
*/
// (number | string)[] 表示数组中的元素是number或者string
let d:(number | string)[] = [1,2,"a","b"];
//  number | string[]  表示内容是number或者string[]
let dd :number | string[] = 123;
let ddd :number | string[] = ["a","b"];